/**
 * Copyright (c) 2024-2025, The Linux Foundation.
 * SPDX-License-Identifier: Apache-2.0
 */

.hidden {
  display: none !important;
}

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-form input,
.filter-form select {
  appearance: none;
  font-family: var(--system-font-family);
  font-size: 14px;
  border-radius: 50px;
  padding: 10px 18px;
  background-color: var(--input-background-color);
  color: var(--body-color);
  transition: all 0.3s ease;
  box-shadow: none;
}

.filter-form input:focus, .filter-form select:focus {
  border-color: var(--input-focus-border-color);
}

.form-group {
  flex: 1 1 200px;
  display: grid;
  grid-template-rows: auto 1fr;
  margin-bottom: 10px;
}

.filter-form .form-group label {
  color: var(--body-color);
  font-size: 10px;
  text-transform: uppercase;
  padding-left: 18px;
  margin-bottom: 5px;
}

.filter-form #family, .filter-form #series, .filter-form #soc {
  overflow: auto;
  border-radius: 8px;
  padding-right: 18px;
}

.filter-form #family option:checked,
.filter-form #series option:checked,
.filter-form #soc option:checked {
  background-color: var(--admonition-note-title-background-color);
  color: var(--admonition-note-title-color);
}

.select-container {
  position: relative;
}

.select-container::after {
  content: "\25BC";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color: var(--body-color);
}

.filter-form select {
  padding-right: 40px;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  border: 1px solid #ccc;
  border-radius: 50px;
  padding: 5px 18px;
}

.tag-container:focus-within {
  border-color: var(--input-focus-border-color);
}

.tag {
  background-color: var(--admonition-note-background-color);
  color: var(--admonition-note-color);
  padding: 2px 12px 4px 16px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  margin-right: 8px;
}

.tag:hover {
  background-color: #0056b3;
}

.tag::after {
  content: '\00D7'; /* multiplication sign */
  margin-left: 8px;
  font-size: 12px;
  cursor: pointer;
}

.filter-form input.tag-input {
  flex: 1;
  border: none;
  padding: 5px;
  outline: none;
  background-color: transparent;
}

.visibility-toggles {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.toggle-group input {
  display: none;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.toggle-switch {
  width: 36px;
  height: 18px;
  background: #ccc;
  border-radius: 18px;
  position: relative;
  transition: 0.3s;
}

.toggle-switch::before {
  content: '';
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: 0.3s;
}

.toggle-text {
  font-size: 14px;
  text-transform: none;
}

input:checked + .toggle-label .toggle-switch {
  background: var(--admonition-note-title-background-color);
}

input:checked + .toggle-label .toggle-switch::before {
  left: 20px;
}

#catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 40px;
}

.board-card {
  flex: 1 1 calc(33.3% - 20px);
  /* Three cards per row */
  max-width: calc(33.3% - 20px);
  border-radius: 8px;
  padding: 15px 20px;
  background-color: var(--admonition-note-background-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
  position: relative;
}

.board-card:hover,
.board-card:focus {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
  text-decoration: none;
}

.board-card.shield::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 48px 48px 0;
  border-color: transparent var(--admonition-note-title-background-color) transparent transparent;
  border-radius: 0 8px 0 0;
}

.board-card.shield::after {
  rotate: 45deg;
  content: "SHIELD";
  position: absolute;
  top: 7px;
  right: 6px;
  color: var(--admonition-note-title-color);
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-card .picture {
  width: auto;
  height: auto;
  min-height: 100px;
  max-height: 180px;
  border-radius: 4px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-grow: 1;
  padding: 10px 0px;
}

.board-card .no-picture {
  font-size: 5em;
  color: var(--admonition-note-title-background-color);
  justify-content: center;
}

.board-card .vendor {
  font-size: 12px;
  color: var(--body-color);
  margin-bottom: 18px;
}

.board-card img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.board-card .board-name {
  font-family: var(--header-font-family);
  margin: auto 0 5px;
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  color: var(--body-color);
  padding-top: 10px;
}

.board-card .arch {
  margin: 5px 0;
  text-align: center;
  font-size: 12px;
  font-weight: 100;
  color: var(--body-color);
}

@media (max-width: 1024px) {
  .board-card {
    flex: 1 1 calc(50% - 20px);
    max-width: calc(50% - 20px);
  }
}

@media (max-width: 768px) {
  .board-card {
    flex: 1 1 calc(100% - 20px);
    max-width: calc(100% - 20px);
  }

  .board-card .picture {
    min-height: 60px;
    max-height: 120px;
  }
}

#form-options .btn {
  font-size: 14px;
}

#form-options .btn:focus {
  outline-color: var(--body-color) !important;
}

#catalog.compact {
  display: block;
  list-style-type: disc;
  margin: 20px;
}

#catalog.compact .board-card {
  display: list-item;
  padding: 4px 0;
  border: none;
  background-color: transparent;
  box-shadow: none;
  list-style-position: outside;
  max-width: none;
}

#catalog.compact .board-card.shield::before {
  display: none; /* Remove the S prefix */
}

#catalog.compact .board-card.shield::after {
  content: "Shield";
  color: var(--admonition-note-color);
  background-color: var(--admonition-note-background-color);
  padding: 2px 10px 2px 10px;
  border-radius: 30px;
  font-size: 0.8em;
}

#catalog.compact .board-card.shield {
  padding: 4px 0;
}

#catalog.compact .board-card .vendor,
#catalog.compact .board-card .picture {
  display: none;
}

#catalog.compact .board-card .board-name {
  display: inline;
  font-family: var(--system-font-family);
  text-align: left;
  font-size: 16px;
  font-weight: normal;
  color: var(--body-color);
  margin: 0;
  padding: 0;
}

#catalog.compact .board-card .arch {
  display: inline;
}

#catalog.compact .board-card .arch::before {
  content: " (";
}

#catalog.compact .board-card .arch::after {
  content: ")";
}

#catalog.compact .board-card:hover {
  box-shadow: none;
  transform: none;
  text-decoration: underline;
}